<?php

namespace Controller\UC;

class Left extends \Controller\Base {

    public function actionIndex() {
        $categoryInfo = $this->getUCParam('categoryInfo');
        $categoryId = $this->getUCParam('categoryId');
        // 获取子分类
        $isShowContacts = false;
        if (!$categoryId || $categoryInfo['Type'] ) {
            $categories = \Data\Category::instance()->getRootCategories(array(1, 2));
            $isShowContacts = true;
        } else {
            $categories = \Data\Category::instance()->getCategoryByPid($categoryInfo['CategoryId']);
        }
        $this->assign('isShowContacts', $isShowContacts);
        $this->assign('categories', $categories);
        $this->assign('categoryInfo', $categoryInfo);
        $this->assign('categoryId', $categoryId);
        $this->display();
    }
}